import logging
import time

from selenium.webdriver.chrome import webdriver
from selenium.webdriver.common.by import By
from common.dologs import DoLog
dolog = DoLog().set_get_logger(logging.INFO)

class LoginPage():
    searchh=(By.ID,"keyword")
    submitt=(By.NAME,"imageField")

    def login(self,s):
        wd = webdriver.WebDriver()
        wd.get("http://172.16.0.26")
        wd.implicitly_wait(10)
        wd.maximize_window()
        wd.find_element(*self.searchh).click()
        wd.find_element(*self.searchh).send_keys(s)
        time.sleep(1)
        wd.find_element(*self.submitt).click()
        time.sleep(3)
        wd.close()
if __name__ =='__main__':
    lg=LoginPage()
    lg.login(s="钻石")
